package hospital.controller;

import hospital.result.Result;
import hospital.service.DepartmentService;
import hospital.vo.hosp.DepartmentVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author
 * @description:
 */
@RestController
@RequestMapping("/admin/hosp/department")
//@CrossOrigin       //跨域注解
@Api(tags = "科室列表")
public class DepartmentController {
    @Autowired
    private DepartmentService departmentService;

    /**
     * @Author yang
     * @Description //TODO 根据医院的编号，得到所有的科室列表
     * @Param
     * @return 
     **/
    @GetMapping("getDepartmentList/{hoscode}")
    @ApiOperation("根据医院的编号，得到所有的科室列表")
    public Result getDepartmentList(@PathVariable String hoscode){
        List<DepartmentVo> list=departmentService.getDepartmentList(hoscode);
        return Result.ok(list);
    }
}
